Skip to content

fix(tunnel): extract JSON log lines instead of double-wrapping#141

Merged
skevetter merged 1 commit into
mainfrom
fbeb/tunnel-json-log-passthrough
Apr 26, 2026
Merged

fix(tunnel): extract JSON log lines instead of double-wrapping#141
skevetter merged 1 commit into
mainfrom
fbeb/tunnel-json-log-passthrough

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

When the inner agent logs JSON (Format: json), TunnelLogStreamer.logLine() was wrapping the entire JSON string as a message field, producing double-encoded JSON output. extractLogLevel() also didn't handle JSON format.

Now logLine() detects JSON log lines by attempting json.Unmarshal, extracts the message/msg and level fields, and logs the message text directly at the correct level — matching the jsonLine pattern used in pkg/log/jsonstream.go. Plain text log lines continue to work as before (backward compatible).

Adds regression tests covering JSON passthrough, level normalization (tracedebug, warningwarn, fatalerror), plain text fallback, empty/whitespace handling, and JSON-without-message edge case.

@coderabbitai

coderabbitai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 35b48453-5734-45af-afcc-32e111288f3a

📥 Commits

Reviewing files that changed from the base of the PR and between dd44b7e and 3c99a69.

📒 Files selected for processing (2)
  • pkg/devcontainer/sshtunnel/sshtunnel.go
  • pkg/devcontainer/sshtunnel/sshtunnel_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify

netlify Bot commented Apr 26, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 3c99a69
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/69eda7e00a4e480008975655

@github-actions

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.

Learn how to use 1Password to sign your commits.

Watch the demo

When the inner agent logs JSON (Format: json), TunnelLogStreamer.logLine()
was wrapping the entire JSON string as a message field, producing
double-encoded output. Now logLine() detects JSON log lines, extracts
the message and level fields, and logs them directly. Plain text lines
continue to work as before.
@skevetter
skevetter force-pushed the fbeb/tunnel-json-log-passthrough branch from 7114826 to 3c99a69 Compare April 26, 2026 05:51
@skevetter
skevetter merged commit 43ceb3f into main Apr 26, 2026
47 checks passed
@skevetter
skevetter deleted the fbeb/tunnel-json-log-passthrough branch April 26, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant